﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeFile="AddSchedule.aspx.cs" Inherits="FYP14.AddSchedule" %>
<%@ Register TagPrefix="DTC" TagName="DateTimeControl" Src="~/DateTimePicker.ascx"%>
<%@ Register TagPrefix="DTCA" TagName="DateTimeControlA" Src="~/DateTimePickerSecond.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="adminpnl" runat="server">
    <script type="text/javascript">
        var statesave = 0;
        function ShowHideDetailsection()
        {
            if (document.getElementById('<%=divdetailsection.ClientID%>').style.display = 'none' && statesave == 0) {
                document.getElementById('<%=divdetailsection.ClientID%>').style.display = 'block';
                statesave = 1;
                //alert(statesave);
            }
            else
            {
                document.getElementById('<%=divdetailsection.ClientID%>').style.display = 'none';
                statesave = 0;
                //alert(statesave);
            }
        }
    </script>
  <!--<link rel="stylesheet" href="css/jquery-ui.css"/>
  <script src="js/jquery-1.9.1.js"></script>
  <script src="js/jquery-ui.js"></script>
  <link rel="stylesheet" href="css/style.css" />
    <script>
        $(function () {
            var icons = {
                header: "ui-icon-circle-arrow-e",
                activeHeader: "ui-icon-circle-arrow-s"
            };
            $("#accordion").accordion({
                collapsible: true,
                icons: icons,
                heightStyle: "content"
            });
            $("#toggle").button().click(function () {
                if ($("#accordion").accordion("option", "icons")) {
                    $("#accordion").accordion("option", "icons", null);
                } else {
                    $("#accordion").accordion("option", "icons", icons);
                }
            });

            //$("#accordion").accordion({active: 1});
        });
    </script>-->
    
    <div class="right_content">
        <h2>Add / Edit Schedule</h2>


        <div id="divdetail" runat="server">
            <table>
                <tr>
                    <td>Doctor
                    </td>
                    <td>
                        <img src="img/0.png" class="NFTextLeft" />
                        <div class="NFTextCenter">
                            <asp:DropDownList ID="ddldoctor" runat="server" CssClass="NFText"></asp:DropDownList>
                        </div>
                        <img src="img/0.png" class="NFTextRight" />
                    </td>
                </tr>
                <tr>
                    <td>Schedule Name
                    </td>
                    <td>
                        <img src="img/0.png" class="NFTextLeft" />
                        <div class="NFTextCenter">
                            <asp:TextBox ID="txtScheduleName" runat="server" required CssClass="NFText"></asp:TextBox>
                        </div>
                        <img src="img/0.png" class="NFTextRight" />
                    </td>
                </tr>
                <tr>
                    <td align="right" colspan="2">
                        <!-- <asp:Button id="btnCancel" Text="Cancel" runat="server" OnClick="btnCancel_Click" /> -->
                        <asp:Button id="btnSave" Text="Save" runat="server" OnClick="btnSave_Click"/>
                    </td>
                </tr>
            </table>
        </div>

        <asp:HyperLink ID="hypShowHide" runat="server" onclick="javascript:ShowHideDetailsection();return false;">Show / Hide Detail</asp:HyperLink>

        <div id="divdetailsection" runat="server" style="display: none">
            <h3>View Schedule Details</h3>
            <asp:GridView ID="gvPurchase" runat="server" AutoGenerateColumns="False" CssClass="rounded-corner"
                RowStyle-CssClass="gridRow" EditRowStyle-CssClass="gridEditRow"
                FooterStyle-CssClass="gridFooterRow" OnRowDataBound="gvPurchase_RowDataBound" DataKeyNames="schedule_detail_id"
                AllowPaging="True" AllowSorting="True" OnPageIndexChanging="gvPurchase_PageIndexChanging" PageSize="20">
                <AlternatingRowStyle CssClass="gridAltRow"></AlternatingRowStyle>
                <Columns>
                    <asp:BoundField DataField="schedule_detail_id" HeaderText="ID" />
                    <asp:BoundField DataField="day_of_week" HeaderText="Day Of Week" />
                    <asp:BoundField DataField="from_time" HeaderText="From Date" />
                    <asp:BoundField DataField="to_time" HeaderText="To Date" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:ImageButton ID="lnkEdit" runat="server" OnClick="lnkRemove_Click" CommandArgument='<%# Eval("schedule_detail_id") %>' ImageUrl="images/user_edit.png"></asp:ImageButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle CssClass="gridEditRow"></EditRowStyle>
                <FooterStyle CssClass="gridFooterRow"></FooterStyle>
                <RowStyle CssClass="gridRow"></RowStyle>
                <PagerSettings FirstPageText="First" LastPageText="Last" NextPageText="Next" PreviousPageText="Previous" />
                <PagerStyle CssClass="grid_paging" />
                <EmptyDataTemplate>No Detail(s) Found.</EmptyDataTemplate>
            </asp:GridView>
            <table>
                <tr>
                    <td colspan="2">
                        <h3 id="addScheduleDetail" runat="server">Schedule Detail</h3>
                    </td>
                </tr>
                <tr>
                    <td>Day of Week
                    </td>
                    <td>
                        <img src="img/0.png" class="NFTextLeft"/>
                    <div class="NFTextCenter">
                        <asp:DropDownList ID="ddlDayOfWeek" runat="server" CssClass="NFText" >
                            <asp:ListItem Text="1" Value="1"></asp:ListItem>
                            <asp:ListItem Text="2" Value="2"></asp:ListItem>
                            <asp:ListItem Text="3" Value="3"></asp:ListItem>
                            <asp:ListItem Text="4" Value="4"></asp:ListItem>
                            <asp:ListItem Text="5" Value="5"></asp:ListItem>
                            <asp:ListItem Text="6" Value="6"></asp:ListItem>
                            <asp:ListItem Text="7" Value="7"></asp:ListItem>
                        </asp:DropDownList>
                        </div>
                    <img src="img/0.png" class="NFTextRight"/>
                    </td>
                </tr>
                <tr>
                    <td>From
                    </td>
                    <td>
                        <DTC:DateTimeControl ID="dtcdate" runat="server" required />
                    </td>
                </tr>
                <tr>
                    <td>To
                    </td>
                    <td>
                        <DTCA:DateTimeControlA ID="dtcTodate" runat="server" required />
                    </td>
                </tr>
                <tr>
                    <td align="right" colspan="2">
                        <asp:Button id="btnSaveDetail" Text="Save" runat="server" OnClick="btnSaveDetail_Click" />
                    </td>
                </tr>
            </table>
        </div>

    </div>
</asp:Content>
